﻿
@using Abp.Web.Mvc.Extensions
@using MyCompanyName.AbpZeroTemplate.Web.Navigation
@using MyCompanyName.AbpZeroTemplate.Web.Bundling
@using System.Threading
@using System.Web.Optimization
@using Abp.Extensions
@using Abp.MultiTenancy
@using Abp.Timing
@using Abp.Web.Mvc.Extensions
@using MyCompanyName.AbpZeroTemplate.Features
@using MyCompanyName.AbpZeroTemplate.Localization
@model  MyCompanyName.AbpZeroTemplate.Agent.Dto.AgentDto

@{
    ViewBag.CurrentPageName = PageNames.App.AgentManager.AgentList;
}

@Html.IncludeScript("~/Areas/Mpa/Views/Agent/CreteOrUpdate.js")
<style>
    .divflow {
        margin-left: -40px;
        margin-right: 0px;
    }
</style>
<div class="row">
    <div class="col-md-12">
        <div class="portlet light form-fit bordered">
            <div class="portlet-title" style="padding:8px 0px 0px 0px!important;">
                <!--标题-->
                <div class="col-md-3">
                    <div class="caption font-dark" style="padding-top:10px;font-size:15px;">
                        <i class="icon-settings font-dark"></i>
                        <span class="caption-subject bold uppercase"> 新增代理商</span>
                    </div>
                </div>
                <div class="col-md-4">

                </div>
                <div class="col-md-3">

                </div>
                <div class="col-md-2">
                    <div class="btn-group" style="float:right;">
                        <button type="button" class="btn blue" onclick="history.back(-1);">返回</button>
                    </div>
                </div>

            </div>
            <div style="background-color:#0066b3;width:100%;height:2px;">
            </div>
            <!--内容-->
            <div class="portlet-body">
                <form action="#" id="form_sample_1" class="form-horizontal" novalidate="novalidate" style="overflow:hidden;">
                    <div class="form-body" style="overflow:hidden;">
                        <div class="row">
                            <div class="col-md-6">
                                <div class="form-group divflow">
                                    <label class="control-label col-md-4">
                                        代理商账号
                                        <span class="required" aria-required="true"> * </span>
                                    </label>
                                    <div class="col-md-6">
                                        @if (@Model.AgentCode != null)
                                        {
                                        <input type="text" class="form-control" data-required="1" id="AgentCode" readonly="readonly" value="@Model.AgentCode">
                                        <input type="text" id="AgentId" value="@Model.Id" hidden="hidden">
                                        }
                                        else
                                        {
                                        <input type="text" class="form-control" data-required="1" id="AgentCode" placeholder="代理商账号">
                                        <input type="text" id="AgentId" value="0" hidden="hidden">
                                        }
                                    </div>
                                </div>
                            </div>
                            <div class="col-md-6">
                                <div class="form-group divflow">
                                    <label class="control-label col-md-4">
                                        代理商名称
                                        <span class="required" aria-required="true"> * </span>
                                    </label>
                                    <div class="col-md-6">
                                        <input id="AgentName" type="text" class="form-control" placeholder="代理商名称" value="@Model.AgentName">
                                    </div>
                                </div>
                            </div>
                        </div>

                        <div class="row">
                            <div class="col-md-6">
                                <div class="form-group divflow" >
                                    <label class="control-label col-md-4">
                                        地址
                                        <span class="required" aria-required="true"> * </span>
                                    </label>
                                    <div class="col-md-6">
                                        <input type="text" id="Address" data-required="1" class="form-control" placeholder="地址" value="@Model.Address">
                                    </div>
                                </div>
                            </div>
                            <div class="col-md-6">
                                <div class="form-group divflow" >
                                    <label class="control-label col-md-4">
                                        联系电话
                                        <span class="required" aria-required="true"> * </span>
                                    </label>
                                    <div class="col-md-6">
                                        <input id="telephone" type="text" class="form-control" placeholder="联系电话" value="@Model.TelePhone">
                                    </div>
                                </div>
                            </div>
                        </div>

                        <div class="row">
                            <div class="col-md-6">
                                <div class="form-group divflow" >
                                    <label class="control-label col-md-4">
                                        身份证号
                                        <span class="required" aria-required="true"> * </span>
                                    </label>
                                    <div class="col-md-6">
                                        <input type="text" id="IdCard" data-required="1" class="form-control" placeholder="身份证号" value="@Model.IdCard">
                                    </div>
                                </div>
                            </div>
                            <div class="col-md-6">
                                <div class="form-group divflow">
                                    <label class="control-label col-md-4">
                                        支付宝账号
                                        <span class="required" aria-required="true"> * </span>
                                    </label>
                                    <div class="col-md-6">
                                        <input type="text" id="AlipayAccount" class="form-control" placeholder="支付宝账号" value="@Model.AlipayAccount">
                                    </div>
                                </div>
                            </div>
                        </div>

                        <div class="row">
                            <div class="col-md-6">
                                <div class="form-group divflow">
                                    <label class="control-label col-md-4">
                                        银行名称
                                        <span class="required" aria-required="true"> * </span>
                                    </label>
                                    <div class="col-md-6">
                                        <input type="text" id="BankName" data-required="1" class="form-control" placeholder="银行名称" value="@Model.BankName">
                                    </div>
                                </div>
                            </div>
                            <div class="col-md-6">
                                <div class="form-group divflow">
                                    <label class="control-label col-md-4">
                                        银行卡号
                                        <span class="required" aria-required="true"> * </span>
                                    </label>
                                    <div class="col-md-6">
                                        <input type="text" id="BankAccount" class="form-control" placeholder="银行卡号" value="@Model.BankAccount">
                                    </div>
                                </div>
                            </div>
                        </div>

                        @if (User.Identity.Name.Equals("admin"))
                        {
                            <div class="row">
                                <div class="col-md-6">
                                    <div class="form-group divflow">
                                        <label class="control-label col-md-4">
                                            流量比例
                                            <span class="required" aria-required="true"> * </span>
                                        </label>
                                        <div class="col-md-6">

                                            @if (Model.Proportion == 0)
                                            {
                                                <input type="text" id="Proportion" class="form-control" value="1.46">
                                            }
                                            else
                                            {
                                                <input type="text" id="Proportion" class="form-control" value="@Model.Proportion">
                                            }
                                        </div>
                                    </div>
                                </div>
                            </div>
                        }
                        <div class="row">
                            <div class="col-md-12">
                                <div class="form-group divflow" >
                                    <label class="control-label col-md-2">
                                        备注
                                    </label>
                                    <div class="col-md-8">
                                        <textarea id="Remark" data-required="1" class="form-control" placeholder="备注" rows="3">@Model.Remark</textarea>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="form-actions" style="border-top:1px solid #0066b3;padding:20px;margin:0;">
                        <div class="row">
                            <div class="col-md-offset-10 col-md-9">
                                <button type="button" class="btn green" onclick="CreateSave('@(User.Identity.Name)');">提 交</button>
                                <button type="button" class="btn grey-salsa btn-outline" onclick="history.back(-1);">取 消</button>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
